//
//  AppDelegate.h
//  iOS_NongLian
//
//  Created by n369 on 15/12/14.
//  Copyright © 2015年 NongLian. All rights reserved.
//

#ifndef NongLian_Define_h
#define NongLian_Define_h

// 登录状态变化的通知
#define LoginStatusChanged_NotifiCation @"NotifiCation_LoginStateChanged"

// 屏幕尺寸
#define Screen_Size [UIScreen mainScreen].bounds.size

// 设备定义
#define iPhone4S     (Screen_Size.height == 480? YES: NO)
#define iPhone5S     (Screen_Size.height == 568? YES: NO)
#define iPhone6S     (Screen_Size.height == 667? YES: NO)
#define iPhone6SPlus (Screen_Size.height == 736? YES: NO)

// 设备定义
#define iPhone_4s    @"iPhone4s"
#define iPhone_5s    @"iPhone5s"
#define iPhone_6     @"iPhone6"
#define iPhone6_Plus @"iPhone6 Plus"

// 系统版本
#define iOS6 @"iOS 6"
#define iOS7 @"iOS 7"
#define iOS8 @"iOS 8"
#define iOS9 @"iOS 9"

// 字体定义
#define TextFontWithSize(a) [UIFont fontWithName:@"Arial Unicode MS" size:(a)]

// 粗体
#define TextBoldFontWithSize(a) [UIFont boldSystemFontOfSize:(a)]

#define Default 44
//距离左边边距为10
#define LeftDistance 10
//控件间的距离
#define ControlDistance 20
//屏幕宽度
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
//屏幕高度
#define ScreenHeight [UIScreen mainScreen].bounds.size.height

//安全释放宏
#define Release_Safe(_control) [_control release], _control = nil;

//传入RGBA四个参数，得到颜色
#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
//传入RGB三个参数，得到颜色
#define RGB(r,g,b) RGBA(r,g,b,1.f)
//取得随机颜色
#define RandomColor RGB(arc4random()%256,arc4random()%256,arc4random()%256)

//用户偏好中key
#define kUserName_Key           @"UserName_Key"
#define kUserPassWord_Key       @"UserPassWord_Key"
#define kUserAutoLogin_Key      @"UserAutoLogin_Key"
#define kUerMemberAccessToken   @"memberAccessToken"
#define kUserMember_Seq         @"member_Seq"
#define kLongitude_KEY          @"kLongitude_KEY"
#define kLatitude_KEY           @"kLatitude_KEY"
#define kJoinKey_KEY            @"kJoinKey_KEY"
#define KIsGeTui_KEY            @"kIsGeTui_KEY"

//app第一次运行
#define KApplication_FirstRunning_Key @"Application_FirstRunning"

//字体
#define ColorGroupName RGB(68, 68, 68)
#define ColorGoodName RGB(68, 68, 68)
#define ColorGoodDetail RGB(102, 102, 102)
#define ColorCompanyAndOther RGB(153, 153, 153)

//背景
#define ColorNavigation RGB(44, 147, 253)

//横线
#define ViewHLine(x, y, wid) [self.view addSubview:[Factory createViewWithBackgroundColor:RGB(216, 216, 216) frame:CGRectMake(x, y, wid, .5)]];
#define HLine(x, y, wid) [Factory createViewWithBackgroundColor:RGB(216, 216, 216) frame:CGRectMake(x, y, wid, .5)]
//比例
#define Scale [UIScreen mainScreen].bounds.size.width/375
#define RectNavScale(x, y, wid, hei) CGRectMake((x) * Scale, y<64?y:((y-64) * Scale+64), (wid) * Scale, (hei) * Scale)
#define FontScale(x) [UIFont systemFontOfSize:x * Scale]
/*
// 通知
#define NotifiCation_DisplayCollectionView @"NotifiCation_DisplayCollectionView"

// 弹出Alert的通知
#define AlertNotification @"AlertShowNotification"

// 关闭Alert的通知
#define AlertDismissNotification @"AlertDismissNotification"

// Umeng社会化分享

#define UM_APIKey @"55ee6c4067e58e6ec60002c5"

// QQ / QQZone
#define QQ_APPID          @"1104890993"
#define QQ_APPKey         @"evj4vcbVTy4e0hpW"

// 微信/朋友圈
#define WeiChat_APPID     @"wx50216e6c5f25c06a"
#define WeiChat_APPSecret @"51c7a1462e687a95a690aff4018ea067"

// 临时tonken
#define  testTonken  @"5d08f9a2546542ab7b43733ef3d2a1de6f101569299e62ca20feca8e24cd1588"
 */
#endif

